<div class="wrap">
	<h2>Crear nuevo sorteo</h2>
	<?php 
	$hayMensaje = false;
	if ( $hayMensaje ) {?>
	<div style="background-color: rgb(255, 251, 204);" id="message" class="updated fade">
		<p><?php echo $mensaje; ?></p>
	</div>
	<?php } ?>
	
	<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post" name="nsorteo" id="nsorteo">
	<?php /* INICIO : Formulario PRIMER PASO para la generacion del sorteo */ ?>
	<p>Por favor, complete los campos solicitados para elaborar un nuevo sorteo.</p>
		<table class="form-table">
			<tbody>
				<tr class="form-field form-required">
					<th scope="row"><label for="titulo">T&iacute;tulo:</label></th>
					<td><input name="titulo" id="titulo" type="text" /></td>
				</tr>
				<tr class="form-field">
					<th scope="row"><label for="descripcion">Descripci&oacute;n:</label></th>
					<td><textarea name="descripcion" id="descripcion"></textarea></td>
				</tr>
				<tr class="form-field">
					<th scope="row"><label for="reglas">Reglas:</label></th>
					<td><textarea name="reglas" id="reglas"></textarea></td>
				</tr>
				<tr class="form-field form-required">
					<th scope="row"><label for="titulo"># Premios:</label></th>
					<td><input name="titulo" id="titulo" type="text" size="5" style="width: 50px;" /></td>
				</tr>
				<tr class="form-field">
					<th scope="row"><label>Fecha Inicio</label></th>
					<td><label for="finicio_dia">D&iacute;a:</label> <select name="finicio_dia" id="finicio_dia" style="width: 80px;"><?php for ( $d = 1; $d <= 31; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo ($d < 10) ? "0" . $d : $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select>
					<label for="finicio_mes">Mes:</label> <select name="finicio_mes" id="finicio_mes" style="width: 80px;"><?php for ( $d = 1; $d <= 12; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo ($d < 10) ? "0" . $d : $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select>
					<label for="finicio_anio">A&ntilde;o:</label><select name="finicio_anio" id="finicio_anio" style="width: 80px;"><?php for ( $d = 2007; $d < date("Y") + 5; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select></td>
				</tr>
				<tr class="form-field">
					<th scope="row"><label>Fecha Fin</label></th>
					<td><label for="ffin_dia">D&iacute;a:</label> <select name="ffin_dia" id="ffin_dia" style="width: 80px;"><?php for ( $d = 1; $d <= 31; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo ($d < 10) ? "0" . $d : $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select>
					<label for="ffin_mes">Mes:</label> <select name="ffin_mes" id="ffin_mes" style="width: 80px;"><?php for ( $d = 1; $d <= 12; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo ($d < 10) ? "0" . $d : $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select>
					<label for="ffin_anio">A&ntilde;o:</label><select name="ffin_anio" id="ffin_anio" style="width: 80px;"><?php for ( $d = 2007; $d < date("Y") + 5; $d++ ) {  ?>
						<option value="<?php echo ($d < 10) ? "0" . $d : $d; ?>">&nbsp;&nbsp;<?php echo $d; ?>&nbsp;&nbsp;</option><?php } ?>
					</select></td>
				</tr>
			</tbody>
		</table>
		<p class="submit"><input name="gosorteo" id="gosorteo" class="button-primary" value="Crear sorteo" type="submit" /></p>
	</form>
</div>
